package so.sao.code.service.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import so.sao.code.service.domain.entity.TagBatchLookupTable;


@Repository
public interface TagBatchLookupTableDao extends JpaRepository<TagBatchLookupTable, Long> {

	 @Query(value = "SELECT * FROM tag_batch_lookup_table WHERE tag_batch_lookup_table.seqnum_start + tag_batch_lookup_table.current_count + ?3 < tag_batch_lookup_table.seqnum_end AND type = ?2 AND tag_batch_lookup_table.ese_id= ?1 ORDER BY id ASC", nativeQuery = true)
	List<TagBatchLookupTable> findTagBatchLookupTables(Long eseId, Integer seqType, Long totalTagCount);

	 List<TagBatchLookupTable> findByEseIdAndTagBatchIdIn(Long eseId,List<Long> tagBatchIds);

	TagBatchLookupTable findByTagBatchId(Long tagBatchId);

}
